#include <my_head.h>

int main(int argc, const char *argv[]){
    pid_t pid = fork();
    if(-1 == pid){
        ERR_LOG("fork error");
    }else if(0 < pid){
        sleep(2);
        printf("A%d %d\n", getpid(), getppid());
    }else if(0 == pid){
        if(-1 == (pid = fork())){
            ERR_LOG("fork error");
        }else if(0 < pid){
            sleep(1);
            printf("B%d %d\n", getpid(), getppid());
        }else if(0 == pid){
            printf("C%d %d\n", getpid(), getppid());
        }
    }
    return 0;
}